/*
 * 图像类
 * @Author: ljb
 * @Date: 2018-09-13 11:47:56
 * @Last Modified by:ljb
 * @Last Modified time: 2018-09-13 11:47:56
 */
export default class Pattern {
	/**
	 * @param {Image} image 图片对象
	 * @param {number} x 起点坐标 x
	 * @param {number} y 起点坐标 y
	 * @param {number} width 宽度
	 * @param {number} height 高度
	 */
	constructor(image, x, y, width, height) {
		this.image = image;
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}

	/**
	 *  绘图
	 */
	draw(context) {
		context.drawImage(this.image, this.x, this.y, this.width, this.height);
	}
}
